<template>
  <view class="projectCenter">
    <view class="pro-header">
      <img src="/static/other/projectCenter/left_arrow.png" alt="返回"  mode="aspectFile" class="pro-header-img" @click="goback"/>
      <text class="pro-header-text">项目中心</text>
      <text class="null"></text>
    </view>
    <view class="pro-content">
      <view class="pro-content-item" v-for="item in listData" :key="item.id" @click="handleProjectItemClick(item)">
        <image class="item-icon" :src="item.icon" mode="aspectFill"  ></image>
        <text class="item-text">{{ item.title }}</text>
      </view>
    </view>
  </view>
</template>

<script>
  export default{
    data(){
      return{
        listData:[
          {
            id: 1,
            title: 'UAT环北部湾广西水资源配置工程',
            icon: '/static/other/projectCenter/quality_testing_empty.png',
            path:'/pages/home/workbench/workbench',
          },
        ]
      }
    },
    methods: {
      handleProjectItemClick(item){
       uni.switchTab({
         url: item.path,
        });
      },
      goback(){
        uni.navigateBack({
          delta:1
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  .projectCenter{
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(to bottom, #eaf6ff, #f5faff);
    .pro-header{
     display: flex;
     align-items: center;
     justify-content: space-between;
     background-color:rgb(31,81,154);
     padding: 30px 20px 13px 20px;
     .pro-header-img{
       width: 10px;
       height: 15px;
      }
     .pro-header-text{
       font-size: 17px;
       font-weight: 600;
       color: white;
      }
     .null{
       width: 10px;
       height: 15px;
      }
    }
    .pro-content{
      padding: 15px 10px;
      flex: 1;
      .pro-content-item{
        display:flex;
        align-items: center;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 6px;
        background-color: white;
        position: relative;
        &:before {
          content: '';
          position: absolute;
          right: 10px;
          top: 25px;
          width: 20px;
          height: 20px;
          background: url('/static/other/projectCenter/right.png') no-repeat;
          background-size: 100%;
        }


        &:active {
         background-color: rgba(64, 158, 255, 0.1);
        }
        .item-icon{
          width: 50px;
          height: 50px;
          margin-right: 10px;
        }
        .item-text{
          text-align: left;
          margin-right: 20px;
          flex: 1;
          font-size: 15px;
        }
      }
    }
  }
</style>
